--- title: "Hello R Markdown" author: "Frida Gomam" date: 2015-07-23T21:13:14-05:00 categories: ["R"] tags: ["R Markdown", "plot", "regression"] ---
hello{{% right %}} Last compiled on 03 January, 2021 {{% /right %}} test
library(metricsgraphics)
mjs_plot(mtcars, x = wt, y = mpg) %>% mjs_point(color_accessor = carb,
size_accessor = carb) %>% mjs_labs(x = "Weight of Car",
y = "Miles per Gallon")
## Warning in widget_html(name = class(x)[1], package = attr(x, "package"), :
## metricsgraphics_html returned an object of class `list` instead of a
## `shiny.tag`.
library("threejs")
## Loading required package: igraph
##
## Attaching package: 'igraph'
## The following object is masked from 'package:plotly':
##
## groups
## The following objects are masked from 'package:stats':
##
## decompose, spectrum
## The following object is masked from 'package:base':
##
## union
N = 20000
theta = runif(N)*2*pi
phi = runif(N)*2*pi
R = 1.5
r = 1.0
x = (R + r*cos(theta))*cos(phi)
y = (R + r*cos(theta))*sin(phi)
z = r*sin(theta)
d = 6
h = 6
t = 2*runif(N) - 1
w = t^2*sqrt(1-t^2)
x1 = d*cos(theta)*sin(phi)*w
y1 = d*sin(theta)*sin(phi)*w
i = order(phi)
j = order(t)
col = c(rainbow(length(phi))[order(i)],
rainbow(length(t), start=0, end=2/6)[order(j)])
M = cbind(x=c(x, x1), y=c(y, y1), z=c(z, h*t))
scatterplot3js(M, size=0.1, color=col, bg="black", pch=".")
data(ego)
graphjs(ego, bg="black")
x = 42 * 2
print(x)
## 84
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v tibble 3.0.4 v dplyr 1.0.2
## v tidyr 1.1.2 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.0
## v purrr 0.3.4
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::as_data_frame() masks tibble::as_data_frame(), igraph::as_data_frame()
## x purrr::compose() masks igraph::compose()
## x tidyr::crossing() masks igraph::crossing()
## x dplyr::filter() masks plotly::filter(), stats::filter()
## x dplyr::groups() masks igraph::groups(), plotly::groups()
## x dplyr::lag() masks stats::lag()
## x purrr::simplify() masks igraph::simplify()

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
fit <- lm(dist ~ speed, data = cars)
fit
##
## Call:
## lm(formula = dist ~ speed, data = cars)
##
## Coefficients:
## (Intercept) speed
## -17.579 3.932
plot(1:10,(1:10+rnorm(10)) )

# execute code if the date is later than a specified day
do_it = Sys.Date() > '2018-02-14'

x = rnorm(100)
You can also embed plots. See Figure 1 for example:
par(mar = c(0, 1, 0, 1))
pie(
c(280, 60, 20),
c('Sky', 'Sunny side of pyramid', 'Shady side of pyramid'),
col = c('#0292D8', '#F7EA39', '#C4B632'),
init.angle = -50, border = NA
)
Figure 1: A fancy pie chart.